# Spinner

The `<Spinner>` component can be used to render a visual cue that something is loading.

## Import

```jsx
import { Spinner } from 'bumbag'
```

## Usage

```jsx-live
<Spinner />
```

### Sizes

```jsx-live
<Spinner size="small" />
<Spinner />
<Spinner size="medium" />
<Spinner size="large" />
<Spinner fontSize="50px" />
```

### Colors

```jsx-live
<Spinner color="success" />
<Spinner color="danger" />
<Spinner color="warning" />
```

### Duration

```jsx-live
<Spinner duration="0.2s" />
<Spinner duration="0.6s" />
<Spinner duration="1.2s" />
```

### Track

```jsx-live
<Spinner hasTrack size="large" />
<Spinner hasTrack trackColor="red" size="large" />
```

### Perimeter lengths

```jsx-live
<Spinner perimeter="30%" size="large" />
<Spinner perimeter="60%" size="large" />
<Spinner perimeter="90%" size="large" />
```

### Progress

You can indicate progress on your spinner by adding a `value` prop.

```jsx-live
<Spinner value={25} />
<Spinner value={50} size="medium" />
<Spinner value={75} size="large" />
```

## Spinner Props

<!-- Automatically generated -->

**<Code fontSize="150" marginRight="major-1">color</Code>** <Code fontSize="100" palette="primary">string</Code> 

Color of the spinner.

<Divider marginTop="major-2" marginBottom="major-2" />

**<Code fontSize="150" marginRight="major-1">duration</Code>** <Code fontSize="100" palette="primary">string</Code> 

Duration (or speed) of the spinner animation.

<Divider marginTop="major-2" marginBottom="major-2" />

**<Code fontSize="150" marginRight="major-1">hasTrack</Code>** <Code fontSize="100" palette="primary">boolean</Code> 

Adds a background 'track' to the spinner.

<Divider marginTop="major-2" marginBottom="major-2" />

**<Code fontSize="150" marginRight="major-1">trackColor</Code>** <Code fontSize="100" palette="primary">string</Code> 

The color of the track.

<Divider marginTop="major-2" marginBottom="major-2" />

**<Code fontSize="150" marginRight="major-1">size</Code>**  

<Code isBlock palette="primary" fontSize="150" padding="minor-1" marginBottom="major-2">
{`"default"
  | (string & {})
  | "small"
  | "medium"
  | "large"`}
</Code>

Size of the spinner.

<Divider marginTop="major-2" marginBottom="major-2" />

**<Code fontSize="150" marginRight="major-1">perimeter</Code>** <Code fontSize="100" palette="primary">string</Code> 

Length of the spinner's perimeter as a percentage.

<Divider marginTop="major-2" marginBottom="major-2" />

**<Code fontSize="150" marginRight="major-1">value</Code>** <Code fontSize="100" palette="primary">number</Code> 

Progress value of the spinner.

<Divider marginTop="major-2" marginBottom="major-2" />

<details><Box use="summary" marginBottom="major-2">Inherits <strong><code>Box</code></strong> props</Box>

**<Code fontSize="150" marginRight="major-1">use</Code>**  

<Code isBlock palette="primary" fontSize="150" padding="minor-1" marginBottom="major-2">
{`string
  | (ComponentClass<any, any> & { useProps: any; })
  | (FunctionComponent<any> & { useProps: any; })`}
</Code>

<Divider marginTop="major-2" marginBottom="major-2" />

**<Code fontSize="150" marginRight="major-1">className</Code>** <Code fontSize="100" palette="primary">string</Code> 

<Divider marginTop="major-2" marginBottom="major-2" />

**<Code fontSize="150" marginRight="major-1">children</Code>**  

<Code isBlock palette="primary" fontSize="150" padding="minor-1" marginBottom="major-2">
{`string
  | number
  | boolean
  | {}
  | ReactElement<any, string
  | ((props: any) => ReactElement<any, string
  | ...
  | (new (props: any) => Component<any, any, any>)>)
  | (new (props: any) => Component<...>)>
  | ReactNodeArray
  | ReactPortal
  | ((props: BoxProps) => ReactNode)`}
</Code>

<Divider marginTop="major-2" marginBottom="major-2" />

**<Code fontSize="150" marginRight="major-1">alignX</Code>** <Code fontSize="100" palette="primary">&#34;right&#34; | &#34;left&#34; | &#34;center&#34;</Code> 

<Divider marginTop="major-2" marginBottom="major-2" />

**<Code fontSize="150" marginRight="major-1">alignY</Code>** <Code fontSize="100" palette="primary">&#34;top&#34; | &#34;bottom&#34; | &#34;center&#34;</Code> 

<Divider marginTop="major-2" marginBottom="major-2" />

**<Code fontSize="150" marginRight="major-1">variant</Code>** <Code fontSize="100" palette="primary">string</Code> 

<Divider marginTop="major-2" marginBottom="major-2" />

**<Code fontSize="150" marginRight="major-1">colorMode</Code>** <Code fontSize="100" palette="primary">string</Code> 

<Divider marginTop="major-2" marginBottom="major-2" />

**<Code fontSize="150" marginRight="major-1">disabled</Code>** <Code fontSize="100" palette="primary">boolean</Code> 

<Divider marginTop="major-2" marginBottom="major-2" />

**<Code fontSize="150" marginRight="major-1">overrides</Code>**  

<Code isBlock palette="primary" fontSize="150" padding="minor-1" marginBottom="major-2">
{`{
  useCSSVariables?: boolean;
  altitudes?: AltitudesThemeConfig;
  borders?: BordersThemeConfig;
  borderRadii?: BorderRadiiThemeConfig;
  ... 96 more ...;
  Template?: TemplateThemeConfig;
}`}
</Code>

<Divider marginTop="major-2" marginBottom="major-2" />

**<Code fontSize="150" marginRight="major-1">elementRef</Code>** <Code fontSize="100" palette="primary">((instance: any) =&#62; void) | RefObject&#60;any&#62;</Code> 

<Divider marginTop="major-2" marginBottom="major-2" />

**<Code fontSize="150" marginRight="major-1">themeKey</Code>** <Code fontSize="100" palette="primary">string</Code> 

<Divider marginTop="major-2" marginBottom="major-2" />

</details>
            

## Theming

<Theme component={'Spinner'} overrides={['Spinner.styles.base', 'Spinner.vector.styles.base', { key: 'Spinner.loaderCircle.styles.base', highlightAttribute: 'stroke' }, { key: 'Spinner.trackCircle.styles.base', highlightAttribute: 'stroke', props: { hasTrack: true } }]}>Hello world</Theme>
